package api_service

import (
	"wwt-gin-api/app/global/request"
	"wwt-gin-api/app/service/captcha"
	"wwt-gin-api/app/utils/redis_factory"
)

func AuthFactory() *AuthService {
	return &AuthService{}
}

type AuthService struct {
}

// GetSmsCode 获取短信验证码
func (a *AuthService) GetSmsCode(req *request.SendSmsReq) bool {
	capt := captcha.CaptchaFactory()
	che := capt.VerifyCaptcha(req.CaptchaId, req.Captcha)
	if !che {
		return false
	}
	redisCli := redis_factory.GetOneRedisClient()
	defer redisCli.ReleaseOneRedisClient()
	// 判断手机号是否已注册
	//buyerUserFactory := buyer_user_info.CreateBuyerUserCurdFactory()
	//buyerUserFactory
	return true
}
